<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <p>我是p标签</p>
    <button>显示</button>
    <button>隐藏</button>
    <button>切换</button>
    <script src="../jquery-3.6.0.min.js"></script>
    <script>
        $btns = $("button");
        $p = $("p");

        $btns.eq(0).on("click",function() {
            $p.show(1000);
        })

        $btns.eq(1).on("click",function() {
            $p.hide(1000);
        })

        $btns.eq(2).on("click",function() {
            $p.toggle(1000);
        })
    </script>
</body>
</html>